package logic;

import interfaze.GameSelectorPanel;

/** The class that changes the title of the panel. Need to have the changeTitle() method implemented.
 * @author Team 1
 *
 */
public class SelectGameThread extends Thread {
	
	GameSelectorPanel panel;		//The panel to be processed.
	
	/** SelectGameThread's constructor.
	 * @param panel : the panel that will have lightning effect title.
	 */
	public SelectGameThread(GameSelectorPanel panel) {
		super();
		this.panel = panel;
	}

	public void run() {
		while(!Thread.currentThread().isInterrupted()) {
			//Changes the title.
			panel.changeTitle();
			try {
				Thread.sleep(500);
			} catch (InterruptedException e) {
				Thread.currentThread().interrupt();
			}
		}
	}
}
